package com.huluobo.a2203kotlinshopping.RoomDemo

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update

/**
 *  Created by LC on 2024/6/21.
 */
@Dao
interface LoginDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insertUserInfo(loginBean: LoginBean)

    @Delete
    fun deleteUserInfo(loginBean: LoginBean)

    @Update
    fun updateUserInfo(loginBean: LoginBean)

    @Query("select * from user_info")
    fun queryUserInfo(): List<LoginBean>

    @Query("select * from user_info where username=:username")
    fun queryUserInfoByName(username: String): LoginBean
}